import logo from './logo.svg';
import './App.css';
import React, { useCallback, useEffect, useState } from 'react';
import { click } from '@testing-library/user-event/dist/click';
import { useMemo } from 'react';

function Bpp(props){
    const {click}=props
    console.log('bpp执行');
    return (
      <div>
     <h1 onClick={click}> Bpp</h1>  
     
      </div>
    )

}

const BppMemo=React.memo(Bpp)
function App(){

  
  const [count,setCount]=useState(0)
 
  function click2(){
    setCount(count+1)
  }
 const click1= useCallback(()=>{
   
      console.log('1 函数');
    
  },[])
 let name=useMemo(()=>{
  return {}
 },[])
 
   return (
    <div>
      <div onClick={click2}>{count}</div>
      <BppMemo click={click1} name={name}/>
    </div>
   )
}

export default App;
